package com.compass.mobile.ui.dialog

import android.view.Gravity
import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.fragment.app.FragmentActivity
import com.compass.mobile.databinding.DialogGoodAtBinding
import com.compass.mobile.framework.base.BaseDialog
import com.compass.mobile.framework.base.BaseDialogFragment
import com.compass.mobile.framework.ext.onClick
import com.compass.mobile.models.DoctorInfo

/**
 * Description： 医生简介
 * Date:2024/6/12 10:05
 */
class DoctorGoodAtDialog {
    class Builder(activity: FragmentActivity,private var doctorInfo: DoctorInfo?) : BaseDialogFragment.Builder<Builder>(activity) {


        private val mBinding: DialogGoodAtBinding =
            DialogGoodAtBinding.inflate(LayoutInflater.from(activity))

        init {

            initView()
        }

        private fun initView() {
            setContentView(mBinding.root)
            setWidth((AppManager.getScreenHeightPx() * 0.4).toInt())
            setHeight(ViewGroup.LayoutParams.MATCH_PARENT)
            setAnimStyle(BaseDialog.AnimStyle.RIGHT)
            gravity = Gravity.RIGHT
            doctorInfo?.let {
                mBinding.tvIntroduce.text = it.introduce
                mBinding.tvMeritIllness.text = it.meritIllness ?: "暂未填写"
                mBinding.tvMeritTherapeutic.text = it.meritTherapeutic ?: "暂未填写"
            }



            mBinding.tvCancel.onClick {
                dismiss()
            }
        }


    }
}
